// sleep函数
exports.sleep = function(time) {
  return new Promise(function (resolve, reject) {
    setTimeout(function () {
      resolve()
    }, time)
  })
}

/**
 * 生成[n, m]随机数
 * @param {number} min
 * @param {number} max
 */
exports.random = function(min, max) {
  let range = max - min
  let rand = Math.random()
  let num = min + Math.round(rand * range)
  return num
}